speed = 80
dist = 180

resetRotationCount(A)
forward(A, speed)
repeat
  if rotationCount(A) > dist then
     resetRotationCount(A)
     resetRotationCount(C)
     forward(C, speed)
  elseif rotationCount(C) > dist then
     resetRotationCount(C)
     resetRotationCount(A)
     forward(A, speed)
  end
until isPressed(ESCAPE)
stop(A)
stop(C)


